<?php
//
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'main';
if($_RQ['op']=='main'){
	$return['ischecklogin']=model('jy_weishop/member')->checklogin('','','','',true);
	if($_SESSION['uid'] && $this->plugin_exists('jy_yuejie')){
		$return['showintype']=model('jy_yuejie/member')->checkinlog();
	}
	$return['member']=cfc('core')->get_member($_SESSION['uid']);
	$goods=pdo_get('jy_yxfrom_list',array('id'=>intval($_RQ['id']),'uniacid'=>$_SESSION['uniacid']));
	$goods['images']=$goods['images']?json_decode($goods['images'],true):array($goods['image']);
	foreach($goods['images'] as &$img){
		$img=tomedia($img);
	}
	$goods['salenum']=pdo_count('jy_yxfrom_order',array('pid'=>$goods['id'],'uniacid'=>$_SESSION['uniacid']));
	$sharelink='jy_yxfrom/fuwu.detail//id='.$goods['id'].'&fromuser='.$_SESSION['uid'];
	$return['sharedata']=array(
			'title'=>$goods['title'],
			'desc'=>$goods['desc']?:'项目列表，一个属于自己的在线报修系统！',
			'link'=>custom_url($sharelink,true),
			'imgUrl'=>tomedia($goods['image'])
	);
	$return['goods']=$goods;
	$return['shopset']=plugin('jy_weishop')->plugin_setting('shopset');
	$return['list']=array();
	set_html('title',$goods['title']);
	exi($return);
}
?>